package com.ymatou.iapi.userservice.parameter.enums;

/**
 * 登录名枚举
 * Created by liguo on 2016/12/7.
 */
public enum LoginNameEnum {

    LoginId(0, "LoginId"),

    Mobile(1, "Mobile"),

    Mail(2, "Mail");

    private int code;
    private String message;


    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    LoginNameEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public static LoginNameEnum getLoginIdTypeEnum(int code) {
        for (LoginNameEnum loginNameEnum : LoginNameEnum.values()) {
            if (loginNameEnum.getCode() == code) {
                return loginNameEnum;
            }
        }
        return null;
    }
}
